import Vue from 'vue'
import VueRouter from 'vue-router'
import home from '../views/home.vue'
import preview from '../views/preview.vue'
import questionnaire from '../views/questionnaire.vue'


Vue.use(VueRouter)

const routes=[
    {
        path:'/home',
        name:'',
        component:home,
        children:[
            {
                path:'questionnaire',
                component:questionnaire
            },
            {
                    path:'preview',
                   name:'preview',
                   component:preview,
            },
             {
        path:'/home',
        // redirect:'/home/questionnaire'
    }

        ]
    },
    {
        path:'/',
        redirect:'home'
    },
   
]

const router =new VueRouter({
    mode:'history',
    base:process.env.BASE_URL,
    routes
})

export default router